/**
主要回顾：多态

实现的多态（跟继承的多态一样）
*/

interface Dao{
    public void add();
    public void delete();
}

class UserDao implements Dao{
    public void add(){
        System.out.println("add successfully...");
    }
    
    public void delete(){
        System.out.println("delete successfully...");
    }
}

class LearnPolymorphism2 {
    public static void main(String[] args) {
        //接口关系下的多态
        Dao d = new UserDao();    //接口的引用类型变量指向实现类的对象
        d.add();
        d.delete();
    }
}